#ifndef CONIN_UI_FONT_H
#define CONIN_UI_FONT_H

#include <windows.h>

namespace cnc {

	namespace ui {
	
		class Font
		{
			HFONT hFont_;
		public:
			Font(LONG pointSize, LPCTSTR lpszFace, bool bold = false,
				bool italic = false)
			{
				HDC hdc = GetDC(NULL);
				hFont_ = CreateFont(-MulDiv(pointSize,
					GetDeviceCaps(hdc, LOGPIXELSY), 72), 0,
					0, 0, bold ? FW_BOLD : FW_REGULAR, italic ? TRUE : FALSE,
					FALSE, FALSE, DEFAULT_CHARSET,
					OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
					DEFAULT_PITCH | FF_DONTCARE, lpszFace);
				ReleaseDC(NULL, hdc);
	
			}
			~Font()
			{
				DeleteObject(hFont_);
			}
			HFONT getHandle() const
			{
				return hFont_;
			}
		};
	
	} // namespace ui

} // namespace cnc

#endif
